//战争迷雾，同时用于部队移动时消除迷雾

var warMist = {
	mistSprites : [],
	
	Initialize : function(){
		this.mistSprites = [];
		for (var tileIndex = 0; tileIndex < tileEngine.tileCount; tileIndex++){
			var sprite = new cc.Sprite(campaign.zone.real_image);
			this.mistSprites[tileIndex] = sprite;
			sprite.attr(tileEngine.IndexToCoord(tileIndex));
			sprite.setColor(cc.color(0,0,0,127));
			mainMap.node.addChild(sprite,101);
		}
	},
	
	RefreshUI : function(){
		for (var tileIndex = 0; tileIndex < forceInfo[showingForce].seeMap.length; tileIndex++){
			this.mistSprites[tileIndex].setVisible(! forceInfo[showingForce].seeMap[tileIndex]);
		}
	},
	
	RefreshTileVisible : function(tileIndex){
		this.mistSprites[tileIndex].setVisible(false);
	},
	
	RefreshTileAndNeighbourVisible : function(tileIndex){
		this.RefreshTileVisible(tileIndex);
		for (var neighborid in tileEngine.neighborCache[tileIndex]){
			var tgtindex = tileEngine.neighborCache[tileIndex][neighborid];
			this.RefreshTileVisible(tgtindex);
		}
	}
};